package com.cq.mapper;

import com.cq.pojo.Meeting;
import com.cq.pojo.Room;
import com.cq.pojo.User;
import com.cq.pojo.User_meeting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: 悠久的苍穹
 * @Date: 2021/1/25 15:04
 * @Description: ${description}
 * @Version: 1.0
 */
@Mapper
@Repository
public interface MeetingMapper {

    int addMeeting(Meeting meeting);

    List<Meeting> getMeetings(@Param("page") int page, @Param("limit") int limit);

    Meeting getMeetingById(@Param("id") int id);

    int findMeeting(Meeting meeting);

    void addUserMeeting(@Param("uuid") String uuid, @Param("meeting_id") int meeting_id);

    User findUserByMeetingId(@Param("meetingId") String meetingId);

    Room findRoomById(@Param("roomId") String roomId);

    void updateMeetingStatus(Meeting meeting);

    void addMeetingRoom(@Param("meetingId") int meetingId, @Param("roomId") int roomId);

    void addRoom(Room room);

    Integer findRoomId(Room room1);

    String getRtmpUrlByMeetingId(@Param("id") String id);

    void updateMeetingHot(@Param("id") int id);

    void updateMeetingCold(@Param("id") int id);

    List<Meeting> getHotMeetings();

    int getCount();


    List<Meeting> getAllMeetings();

    int getTimeCount(@Param("start") String start, @Param("end") String end);

    List<Meeting> getMeetingsByTime(@Param("page") int page, @Param("limit") int limit, @Param("start") String start, @Param("end") String end);

    void deleteMeetingById(@Param("id") int id);

    int getLiveCount();

    String getRoomIdByMeetingId(@Param("meetingId") String meetingId);

    List<Meeting> getMeetingsByJoin(@Param("userId") String userId);

    List<Meeting> getMeetingsByApply(@Param("userId") String userId);

    Meeting findMeetingByRoomId(@Param("roomId") int roomId);

    int updateFavorite(@Param("userId") String userId, @Param("meetingId") String meetingId, @Param("flag") String flag);

    User_meeting findUserMeetingById(@Param("userId") String userId, @Param("meetingId") String meetingId);

    void addUserMeetingFavorite(@Param("userId") String userId, @Param("meetingId") String meetingId);

    List<Meeting> getMeetingsByFavorite(@Param("userId") String userId);
}
